<?php

/**
 * This is the model class for table "hoteltamu".
 *
 * The followings are the available columns in table 'hoteltamu':
 * @property integer $ht_id
 * @property string $ht_klasifikasi
 * @property string $ht_nama
 * @property integer $ht_unit
 * @property integer $ht_kamar
 * @property integer $ht_tempattidur
 * @property integer $ht_tamuasing
 * @property integer $ht_tamuindonesia
 * @property integer $ht_tahun
 */
class Hoteltamu extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Hoteltamu the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'hoteltamu';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('ht_unit, ht_kamar, ht_tempattidur, ht_tamuasing, ht_tamuindonesia, ht_tahun', 'numerical', 'integerOnly'=>true),
			array('ht_klasifikasi', 'length', 'max'=>32),
			array('ht_nama', 'length', 'max'=>64),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('ht_id, ht_klasifikasi, ht_nama, ht_unit, ht_kamar, ht_tempattidur, ht_tamuasing, ht_tamuindonesia, ht_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'ht_id' => 'Ht',
			'ht_klasifikasi' => 'test01',
			'ht_nama' => 'test02',
			'ht_unit' => 'Ht Unit',
			'ht_kamar' => 'Ht Kamar',
			'ht_tempattidur' => 'Ht Tempattidur',
			'ht_tamuasing' => 'Ht Tamuasing',
			'ht_tamuindonesia' => 'Ht Tamuindonesia',
			'ht_tahun' => 'Ht Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('ht_id',$this->ht_id);
		$criteria->compare('ht_klasifikasi',$this->ht_klasifikasi,true);
		$criteria->compare('ht_nama',$this->ht_nama,true);
		$criteria->compare('ht_unit',$this->ht_unit);
		$criteria->compare('ht_kamar',$this->ht_kamar);
		$criteria->compare('ht_tempattidur',$this->ht_tempattidur);
		$criteria->compare('ht_tamuasing',$this->ht_tamuasing);
		$criteria->compare('ht_tamuindonesia',$this->ht_tamuindonesia);
		$criteria->compare('ht_tahun',$this->ht_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}